package bookExercise;

import java.util.List;
import java.util.stream.DoubleStream;
import java.util.stream.Stream;

public class A14Salary {
    public static void main(String[] args) {
        List<A14Emplyee> list =A14Emplyee.getEmpList();
        Stream<A14Emplyee> stream =list.stream();
         stream =stream.filter(n ->"销售部".equals(n.getDept()));
        DoubleStream salary =stream.mapToDouble(A14Emplyee::getSalary);
        double sum =salary.sum();
        System.out.println("销售部一个月的收入"+sum);
    }
}
